package com.ihmp.model;

// Generated Nov 3, 2013 9:48:38 AM by Hibernate Tools 4.0.0

import static javax.persistence.GenerationType.IDENTITY;

import java.util.Date;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

import org.hibernate.annotations.BatchSize;
import org.hibernate.annotations.Cascade;
import org.hibernate.annotations.Fetch;
import org.hibernate.annotations.FetchMode;

/**
 * Trooms generated by hbm2java
 */
@Entity
@Table(name = "trooms", catalog = "ihmp")
public class Trooms implements java.io.Serializable {

	private Integer roomId;
	private Short hotelId;
	private String roomNo;
	private Short block;
	private Short floor;
//	private short roomTypeId;
	private Boolean used;
	private String note;
	private Integer creater;
	private Date createDate;
	private Integer editer;
	private Date editDate;
	private Troomtypes troomtypes;
 
	public Trooms() {
	}

//	public Trooms(short roomTypeId) {
//		this.roomTypeId = roomTypeId;
//	}

	public Trooms(Short hotelId, String roomNo, Short block, Short floor,
			short roomTypeId, Boolean used, String note, Integer creater,
			Date createDate, Integer editer, Date editDate) {
		this.hotelId = hotelId;
		this.roomNo = roomNo;
		this.block = block;
		this.floor = floor;
	//	this.roomTypeId = roomTypeId;
		this.used = used;
		this.note = note;
		this.creater = creater;
		this.createDate = createDate;
		this.editer = editer;
		this.editDate = editDate;
	}

	@Id
	@GeneratedValue(strategy = IDENTITY)
	@Column(name = "RoomID", unique = true, nullable = false)
	public Integer getRoomId() {
		return this.roomId;
	}

	public void setRoomId(Integer roomId) {
		this.roomId = roomId;
	}

	@Column(name = "HotelID")
	public Short getHotelId() {
		return this.hotelId;
	}

	public void setHotelId(Short hotelId) {
		this.hotelId = hotelId;
	}

	@Column(name = "RoomNo", length = 10)
	public String getRoomNo() {
		return this.roomNo;
	}

	public void setRoomNo(String roomNo) {
		this.roomNo = roomNo;
	}

	@Column(name = "Block")
	public Short getBlock() {
		return this.block;
	}

	public void setBlock(Short block) {
		this.block = block;
	}

	@Column(name = "Floor")
	public Short getFloor() {
		return this.floor;
	}

	public void setFloor(Short floor) {
		this.floor = floor;
	}

//	@Column(name = "RoomTypeID", nullable = false)
//	public short getRoomTypeId() {
//		return this.roomTypeId;
//	}
//
//	public void setRoomTypeId(short roomTypeId) {
//		this.roomTypeId = roomTypeId;
//	}

	@Column(name = "Used")
	public Boolean getUsed() {
		return this.used;
	}

	public void setUsed(Boolean used) {
		this.used = used;
	}

	@Column(name = "Note", length = 200)
	public String getNote() {
		return this.note;
	}

	public void setNote(String note) {
		this.note = note;
	}

	@Column(name = "Creater")
	public Integer getCreater() {
		return this.creater;
	}

	public void setCreater(Integer creater) {
		this.creater = creater;
	}

	@Temporal(TemporalType.TIMESTAMP)
	@Column(name = "CreateDate", length = 19)
	public Date getCreateDate() {
		return this.createDate;
	}

	public void setCreateDate(Date createDate) {
		this.createDate = createDate;
	}

	@Column(name = "Editer")
	public Integer getEditer() {
		return this.editer;
	}

	public void setEditer(Integer editer) {
		this.editer = editer;
	}

	@Temporal(TemporalType.TIMESTAMP)
	@Column(name = "EditDate", length = 19)
	public Date getEditDate() {
		return this.editDate;
	}

	public void setEditDate(Date editDate) {
		this.editDate = editDate;
	}

	
	@ManyToOne(fetch = FetchType.EAGER)
	@JoinColumn(name = "roomTypeId", updatable=false, insertable=false)
	@Fetch(FetchMode.SELECT)
    @BatchSize(size = 10)
	public Troomtypes getTroomtypes() {
		return troomtypes;
	}

	public void setTroomtypes(Troomtypes troomtypes) {
		this.troomtypes = troomtypes;
	}

}
